package com.caishi.lkx.exam.ienum.type;

import com.zzw.common.mysql.MybatisPlusEnum;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author lkx
 */
public enum MaterialType implements MybatisPlusEnum<Integer> {
    //
    ssbj("三色笔记", 1),
    kkdg("考试大纲", 2),
    swdt("思维导图", 3),
    zsd("知识点", 4),
    mnzt("模拟真题", 5),
    kqbk("考前必看", 6),
    qt("其他资料", 6)
    ;


    @Getter
    final String desc;

    @Getter
    final Integer value;

    @Override
    public Integer getCode() {
        return value;
    }

    MaterialType(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }

    public static MaterialType int2Obj(int value) {
        return Arrays.stream(MaterialType.values())
                .filter(v -> v.value == value).findFirst().orElse(null);
    }


}
